/*
 * @Date: 2022-01-02 12:27:27
 * @LastEditors: LeeKing
 * @LastEditTime: 2022-01-05 14:50:23
 * @FilePath: \hmmm-20220102\src\main.js
 */
import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' // global css
import App from './App'
import router from './router'
import store from './store'
import i18n from './lang' // Internationalization
import './icons' // icon
import './errorLog' // error log
import * as filters from './filters' // global filters
import './mock' // simulation data
// font-awesome
import 'font-awesome/css/font-awesome.css'
/*
 * 注册 - 业务模块
 */
import dashboard from '@/module-dashboard/' // 面板
import base from '@/module-manage/' // 用户管理
import hmmm from '@/module-hmmm/' // 黑马面面
// // 引入富文本以及相关样式
// import VueQuillEditor from 'vue-quill-editor'
// import 'quill/dist/quill.core.css' // import styles
// import 'quill/dist/quill.snow.css' // for snow theme
// import 'quill/dist/quill.bubble.css'
// // import PuzzleVerification from 'vue-puzzle-verification' // for bubble theme

// // 使用富文本插件
// Vue.use(VueQuillEditor)

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// 导入富文本编辑器样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import hljs from 'highlight.js' // 高亮
Vue.directive('highlight', (el) => {
  const blocks = el.document.querySelectorAll('pre')
  blocks.forEach((block) => {
    hljs.highlightBlock(block)
  })
})
// import Quill from 'quill'
// 将富文本编辑器，注册为全局可用组件
Vue.use(VueQuillEditor)

Vue.use(dashboard, store)
Vue.use(base, store)
// Vue.use(list, store)
// Vue.use(form, store)
// Vue.use(details, store)
Vue.use(hmmm, store) // 高亮
Vue.directive('highlight', (el) => {
  const blocks = el.document.querySelectorAll('pre')
  blocks.forEach((block) => {
    hljs.highlightBlock(block)
  })
})

/*
 * 注册 - 组件
 */

// 饿了么
Vue.use(Element, {
  size: 'medium',
  i18n: (key, value) => i18n.t(key, value)
})
// 过滤器
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false
// 使用封装的登录验证vue组件
// Vue.use(PuzzleVerification)
/* eslint-disable */
new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: (h) => h(App)
})
